<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>动态绑定外部样式——数组语法</title>
    <style>
        .bg {
            background-color: chocolate;
        }

        .line {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<div id="app">
    <!--注意：同一个属性绑定内容只有第一个生效-->
    <h1 v-bind:class="{bg:true}" v-bind:class="{line:true}">Hello, Vue！</h1>
    <h1 v-bind:class="{line:true}" v-bind:class="{bg:true}">Hello, Vue！</h1>
    <!--在处理需要多绑定的时候，使用 数组语法-->
    <h1 v-bind:class="['bg','line']">Hello, Vue！</h1>
    <h1 v-bind:class="arr">Hello, Vue！</h1>


</div>

<script type="module">
    import {createApp, reactive} from "../../../js/vue.esm-browser.js";

    let app = createApp(
        {
            setup() {
                let arr = reactive(['bg', 'line'])
                return {
                    arr
                }
            }
        }
    );

    app.mount("#app")
</script>
</body>
</html>